#!/bin/bash -e

function info() {
echo Usage: `basename $0` 'g.vcf bed'
exit 1
}

while getopts  ":p:f:i:" opt; do
	case  $opt  in
		p) out_prefix=$OPTARG;;
		f) suffix=$OPTARG;;
        i) bed=$OPTARG;;
		*) info;;
	esac
done
shift $(($OPTIND - 1))

if [ $# -lt 1 ]; then info; fi

. $var

# bam=$1
bed=$2
gvcf=$1

# CombineGVCFs # run CombineGVCFs on batches of ~200 gVCFs to hierarchically merge them into a single gVCF

echo; echo GenotypeGVCFs
$java_run/gatk38 \
    -R $ref_genome \
    -T GenotypeGVCFs \
    -L $bed \
    --variant $gvcf \
    -o $out_prefix.gt.vcf \
    -nt 4 \
    --useNewAFCalculator \
    -stand_call_conf 0

. $cmd_done



